﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using DataAnnotationsExtensions;
using System.Web.Mvc;

namespace BenzInfo.Hockey.Grenadiers.Models
{
    [Table("Posts")]
    public class Post : Audit
    {
        [Key]
        public int Id { get; set; }

        [Required]
        [StringLength(50, MinimumLength = 2)]
        public string Key { get; set; }

        [Required]
        [StringLength(100, MinimumLength = 2)]
        [Display(Name = "DisplayTitleEN", ResourceType = typeof(Resources.Models.Post))]
        public string TitleEN { get; set; }

        [Required]
        [StringLength(100, MinimumLength = 2)]
        [Display(Name = "DisplayTitleFR", ResourceType = typeof(Resources.Models.Post))]
        public string TitleFR { get; set; }

        [Required]
        [AllowHtml]
        [MaxLength]
        [Column(TypeName = "ntext")]
        [DataType(DataType.MultilineText)]
        [Display(Name = "DisplayContentEN", ResourceType = typeof(Resources.Models.Post))]
        public string ContentEN { get; set; }

        [Required]
        [AllowHtml]
        [MaxLength]
        [Column(TypeName = "ntext")]
        [DataType(DataType.MultilineText)]
        [Display(Name = "DisplayContentFR", ResourceType = typeof(Resources.Models.Post))]
        public string ContentFR { get; set; }

        [FileExtensions("png|jpg|jpeg|gif")]
        [Display(Name = "DisplayPicture", ResourceType = typeof(Resources.Models.Post))]
        public string Picture { get; set; }
    }
}